import request from '@/utils/request.js'


// 获取列表数据
export const getExpenseList = (params) => {
    return request({
        url: '/expenses/project',
        method: 'get',
        params
    })
}

// 删除列表数据
export const delExpenseList = (id) => {
    return request({
        url: '/expenses/project/' + id,
        method: 'delete'
    })
}

// 新增数据
export const addExpenseList = (data) => {
    return request({
        url: '/expenses/project',
        method: 'post',
        data
    })
}

// 获取详情
export const getExpenseInfo = (id) => {
    return request({
        url: '/expenses/project/' + id,
        method: 'get',
    })
}

// 修改数据
export const editExpenseInfo = (data) => {
    return request({
        url: '/expenses/project/' + data.id,
        method: 'put',
        data
    })
}
// ------------ 下拉 --------------------
// 获取所属楼栋 build
export const getBuild = (code) =>
  request.get(`/house/building?community_code=${code}`);
// 获取所属房产
export const getBuildAll = (code) =>
  request.get(`/house/index?building_code=${code}`);
// 房产回显
export const getBuildInfo = (code, id) =>
  request.get(`/house/index?community_code=${code}&building_code=${id}`);